package config

import "time"

type Config struct {
	General struct {
		LogLevel     int    `mapstructure:"log_level"`
		LaunchServer int    `mapstructure:"launch_server"`
		MdnsAddress  string `mapstructure:"mdns_address"`
		PortBackend  int    `mapstructure:"port_backend"`
	} `mapstructure:"general"`
	MQTT struct {
		Server               string        `mapstructure:"server"`
		Username             string        `mapstructure:"username"`
		Password             string        `mapstructure:"password"`
		MaxReconnectInterval time.Duration `mapstructure:"max_reconnect_interval"`
		QOS                  uint8         `mapstructure:"qos"`
		CleanSession         bool          `mapstructure:"clean_session"`
		ClientID             string        `mapstructure:"client_id"`
		EventTopic           string        `mapstructure:"event_topic"`
		CommandTopicTemplate string        `mapstructure:"command_topic_template"`
		BroadcastTopic       string        `mapstructure:"broadcast_topic"`
	} `mapstructure:"mqtt"`
}

// C holds the global configuration.
var C Config
